package com.ljf.finance.dto.command;

import com.fasterxml.jackson.annotation.JsonIgnore;
import com.fasterxml.jackson.annotation.JsonProperty;
import com.ljf.common.validation.AddGroup;
import com.ljf.common.validation.UpdateGroup;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;
import org.hibernate.validator.constraints.Length;

import javax.validation.constraints.NotEmpty;
import javax.validation.constraints.NotNull;
import java.io.Serializable;
import java.math.BigDecimal;

/**
 * 虚拟账户定义--新增修改  finance_dat_virtual_account
 *
 * @author LJF
 * @since 2024-05-23
 */
@Data
@ApiModel("虚拟账户定义--新增修改")
public class FinanceDatVirtualAccountCommand implements Serializable {

    @JsonProperty("name")
    @ApiModelProperty(value = "名称")
    @Length(message = "名称长度不能超过20个字符", max = 20)
    @NotEmpty(message = "名称不能为空", groups = {AddGroup.class, UpdateGroup.class})
    private String name;

    @JsonProperty("shortName")
    @ApiModelProperty(value = "账户简称")
    @Length(message = "账户简称长度不能超过10个字符", max = 10)
    private String shortName;

    @JsonProperty("commonUsed")
    @ApiModelProperty(value = "是否常用")
    @NotNull(message = "是否常用不能为空", groups = {AddGroup.class, UpdateGroup.class})
    private Integer commonUsed;

    @JsonProperty("sort")
    @ApiModelProperty(value = "排序")
    @NotNull(message = "排序不能为空", groups = {AddGroup.class, UpdateGroup.class})
    private Integer sort;

    @JsonIgnore
    @ApiModelProperty(value = "实时金额")
    private BigDecimal amount;

}
